class MyMath:
    def add(self,a,b):  #加法
        return a+b
    def sub(self,a,b):# 减法
        return a-b
    def mul(self,a,b):# 乘法
        return a*b
    def division(self,a,b):  #除法
        return a/b
    def Power(self,a,b): #Power  幂
        return  a**b
    def sqr(self,a):  #开根
        return a**(1/2)  #  x ** (1 / 2)

math=MyMath()
print(math.add(3,4))
print(math.sub(3,4))
print(math.mul(3,4))
print(math.division(3,4))
print(math.Power(3,4))
print(math.sqr(4))


class Book:
    content="我是父类的一个参数"
    def __int__(self):
        pass
    def __init__(self,sig):
        self.sig=sig
    def __init__(self,a,b):
        self.a=a
        self.b=b

    def add(self):
        return "无参数"

book=Book("a","b")
print(book.content)
print(book.a)
print(book.b)
print(book.add())

class  ToolBook(Book):
    def __int__(self,a):
        self.a=a

    def add(self):
        return "子类 无参数"

    def toolBook(self,a):
        return a

toolBook=ToolBook("a1","a2")
print(toolBook.add())
print(toolBook.toolBook("我是 工具书，你呢？"))

class LiteratureBook(Book):
    def __int__(self):
        self.a="LiteratureBook"

    def literature(self,a):
        return a

literatureBook=LiteratureBook("aa","dd")
print(literatureBook.a)
print(literatureBook.literature("我是文学工具书，你呢？"))


class SonBook(ToolBook,LiteratureBook):

    content = "我是子类的一个参数" #继承 父类的参数
    def __int__(self,a,b):
        self.a=a
        self.b=b

    def toolBook(self,a): #继承 父类的方法
        return a

    def literature(self,a):#继承 父类的方法
        return a

    def myBook(self): #定义自己的方法
        return "我有自己工具"

print("-----------儿子---------")
sonBook=SonBook("儿子","儿子")
print(sonBook.a)
print(sonBook.content)
print(sonBook.toolBook("覆盖"))
print(sonBook.literature("覆盖2"))
print(sonBook.myBook())
print(sonBook.toolBook("我是你们的儿子"))